@extends('shopWx.global')

@section('content')
<div class="page page-current" id="user" data-upurl="{{ action('Shop\UserController@getIndexAjax') }}">
    <header class="bar bar-nav">
        <h1 class="title">プロフィール</h1>
    </header>
    <div class="content">
        <div class="user-header">
            <img width="120" src="{{ $user->thumb }}">
            <span style="background-color: {{ isset($USER_GROUP[$user->groupID]) ? $USER_GROUP[$user->groupID]->color : '' }}" onclick="$.router.load('{{ action('Shop\UserController@getUserLv') }}')">{{ isset($USER_GROUP[$user->groupID]) ? $USER_GROUP[$user->groupID]->name : '' }}</span>
            <p>{{ $user->realName }}</p>
            {{--<p id="storeName" onclick="$.router.load('{{ action('Shop\StoreSelectController@getIndex') }}', true)">{{ $store->name }} ></p>--}}
        </div>
        <div class="list-block list-block-user">
            <ul>
                <li class="item-content item-link" onclick="$.router.load('{{ action('Shop\UserController@getUserSignIn') }}')">
                    <div class="item-media"><i class="fa fa-sign-in"></i></div>
                    <div class="item-inner">
                        <div class="item-title">チエックイン</div>
                        <?php
                            $lastTime = $USER->signTime ? strtotime($USER->signTime) : false;
                            $thisTime = strtotime(date('Y-m-d 00:00:00', time()));
                            $signNum = 0;
                            if($lastTime)
                            {
                                if($thisTime - $lastTime < 86400)
                                    $signNum = $USER->signNum;
                            }
                        ?>
                        <div class="item-after" id="signTip">{!! $signNum ? '<span class="sign-tip">連続 '.$signNum.' 日チェックイン</span>' : '' !!}</div>
                    </div>
                </li>
                <li class="item-content item-link" onclick="$.router.load('{{ action('Shop\UserController@getUserOrder') }}')">
                    <div class="item-media"><i class="fa fa-list-alt"></i></div>
                    <div class="item-inner">
                        <div class="item-title"> 注文履歴</div>
                        <div class="item-after"></div>
                    </div>
                </li>
                <li class="item-content item-link" onclick="$.router.load('{{ action('Shop\UserController@getAddress') }}')">
                    <div class="item-media"><i class="fa fa-map-marker"></i></div>
                    <div class="item-inner">
                        <div class="item-title"> アドレス帳</div>
                        <div class="item-after"></div>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    @include('shopWx.footer-menu')
</div>
@endsection